package com.kuang.method;

public class Demo04 {
    public static void main(String[] args) {
//        Demo04 demo04 = new Demo04();
//        demo04.test(1,2,3,4,5);
        printMax(34,3,3,5);
        printMax(new double[]{1,2,3});
    }
//    public static void test(int ...i){
//        System.out.println(i[0]);
//        System.out.println(i[4]);
//    }
    public static void printMax(double ... numbers){
        if(numbers.length == 0){
            System.out.println("no");
            return ;
        }
        double result = numbers[0];
        for (int i=0;i<numbers.length;i++){
            if(numbers[i]>result){
                result = numbers[i];
            }
        }
        System.out.println("This is:"+result);
    }
}
